#include "Node.h"

Node::Node()
	:data(NULL),
	next(NULL)
{
}

Node::~Node()
{
	if(data != NULL)
		delete data;
}

void Node::setData(Data* datos)
{
	if(data == NULL)
		data = datos->allocate();
	else
	{
		delete data;
		data = datos->allocate();
	}
}

Data* Node::getData()
{
	return data;
}

void Node::setNext(Node* nodo)
{
	next = nodo;
}

Node* Node::getNext()
{
	return next;
}


 
